home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / GNU_KIT / DISK6.ZIP / gnu / man / cat1 / test.1 < prev    next >
Encoding:
Text File  |  1994-01-19  |  5.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. TEST(1L) TEST(1L)
  8. NAME
  9.      test - check file types and compare values
  10. SYNOPSIS
  11.      test [expr]
  12. DESCRIPTION
  13.      This manual page documents the GNU version of test.
  14.      test returns a status of 0 (true) or 1 (false) depending on
  15.                                                   ____               the evaluation of the conditional expression expr. Expres-
  16.      sions may be unary or binary.  Unary expressions are often
  17.      used to examine the status of a file.  There are string
  18.      operators and numeric comparison operators as well.
  19.         ____      -b file
  20.                   ____                                        True if file exists and is block special.
  21.         ____      -c file
  22.                   ____                                            True if file exists and is character special.
  23.         ____      -d file
  24.                   ____                                      True if file exists and is a directory.
  25.         ____      -e file
  26.                   ____                  True if file exists
  27.         ____      -f file
  28.                   ____                                         True if file exists and is a regular file.
  29.         ____      -g file
  30.                   ____                                       True if file exists and is set-group-id.
  31.         ____      -k file
  32.                   ____                                       True if file has its ``sticky'' bit set.
  33.         ____      -L file
  34.                   ____                                          True if file exists and is a symbolic link.
  35.         ____      -p file
  36.                   ____                                       True if file exists and is a named pipe.
  37.         ____      -r file
  38.                   ____                                   True if file exists and is readable.
  39.         ____      -s file
  40.                   ____                                                    True if file exists and has a size greater than zero.
  41.         ____      -S file
  42.                   ____                                   True if file exists and is a socket.
  43.          __       -t [fd]
  44.                   __                              __                       True if fd is opened on a terminal.  If fd is omitted,
  45.           it defaults to 1 (standard output).
  46.         ____      -u file
  47.                   ____                                                  True if file exists and its set-user-id bit is set.
  48.         ____      -w file
  49.                   ____                                   True if file exists and is writable.
  50.         ____      -x file
  51.                   ____                                     True if file exists and is executable.
  52.         ____      -O file
  53.                   ____                                                     True if file exists and is owned by the effective user
  54.           id.
  55.         ____      -G file
  56. Page 1
  57. TEST(1L) TEST(1L)
  58.                   ____                                                      True if file exists and is owned by the effective group
  59.           id.
  60.      _____     _____      file1 -nt file2
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                   _____                                                     True if file1 is newer (according to modification date)
  74.                _____            than file2.
  75.      _____     _____      file1 -ot file2
  76.                   _____                                True if file1 is older than file2.
  77.      _____     ____      file1 -ef file
  78.                   _____     _____                                          True if file1 and file2 have the same device and inode
  79.           numbers.
  80.         ______      -z string
  81.                                 ______                    True if the length of string is zero.
  82.         ______      -n string
  83.      ______      string
  84.                                 ______                        True if the length of string is non-zero.
  85.      _______   _______      string1 = string2
  86.           True if the strings are equal.
  87.      _______    _______      string1 != string2
  88.           True if the strings are not equal.
  89.         ____      !  expr
  90.                   ____                     True if expr is false.
  91.      _____    _____      expr1 -a expr2
  92.                        _____     _____                     True if both expr1 and expr2 are true.
  93.      _____    _____      expr1 -o expr2
  94.                          _____    _____                    True if either expr1 or expr2 is true.
  95.      ____    ____      arg1 OP arg2
  96.           OP is one of -eq, -ne, -lt, -le, -gt, or -ge. These
  97.                                                      ____              arithmetic binary operators return true if arg1 is
  98.           equal, not-equal, less-than, less-than-or-equal,
  99.                                                       ____            greater-than, or greater-than-or-equal than arg2,
  100.                          ____     ____                                     respectively.  arg1 and arg2 may be positive integers,
  101.                                                           ______            negative integers, or the special expression -l string,
  102.                                            ______            which evaluates to the length of string.
  103. Page 2
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.